/********************************************************************************
*																				*
*  Las Venturas Playground - Core/console.nut							        *
*																				*
*  This file will hold console commands.   									    *
*  Should not be included in main gamemode!	Load via settings.xml			    *
*																				*
********************************************************************************/

function onPlayerCommand(playerid, command)
{
	local cmd = split(command, " ");	

	// Commands: /restartgm
	// Params: void
	// Author: Matthias
	if(cmd[0] == "/restartgm")
	{
		local sPlayerName = getPlayerName( playerid );
		if( sPlayerName == "Sander" || sPlayerName == "Nakebod" || sPlayerName == "Matthias")
		{
			local getDate = date(), showDate = format("[%d/%d/%d-%d:%d]", getDate.year, getDate.month, getDate.day, getDate.hour, getDate.sec);
			sendConsoleInput("reloadscript lvp.nut");
			log(format("Scriptfile reloaded "+ showDate ));
			sendPlayerMessage( playerid, "[FF0000FF]"+ showDate +" Restarting...", 0xFFFFFFFF, true );
		}
		return 1;
	}
	return 1;
}

addEvent("playerCommand", onPlayerCommand);